Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Bitstream</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Bitstream"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Bitstream rootpage-Bitstream skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Bitstream</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */


.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}


/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">For the more theoretical concept in computer science, see <a href="Stream_(computer_science)" class="mw-redirect" title="Stream (computer science)">Stream (computer science)</a>.</div>
<div role="note" class="hatnote navigation-not-searchable">For data streams, see <a href="Data_stream" title="Data stream">Data stream</a>.</div>
<div role="note" class="hatnote navigation-not-searchable">For other uses, see <a href="Bitstream_(disambiguation)" class="mw-disambig" title="Bitstream (disambiguation)">Bitstream (disambiguation)</a>.</div>
<style data-mw-deduplicate="TemplateStyles:r1251242444">
/* start https://en.wikipedia.org/ */


.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}


/* end https://en.wikipedia.org/ */
</style>
<p>A <b>bitstream</b> (or <b>bit stream</b>), also known as <b>binary sequence</b>, is a <a href="Sequence" title="Sequence">sequence</a> of <a href="Bit" title="Bit">bits</a>.
A <b>bytestream</b> is a sequence of <a href="Byte" title="Byte">bytes</a>. Typically, each byte is an <a href="Octet_(computing)" title="Octet (computing)">8-bit quantity</a>, and so the term <b>octet stream</b> is sometimes used interchangeably. An octet may be encoded as a sequence of 8 bits in multiple different ways (see <a href="Bit_numbering" title="Bit numbering">bit numbering</a>) so there is no unique and direct translation between bytestreams and bitstreams.
</p><p>Bitstreams and bytestreams are used extensively in <a href="Telecommunications" title="Telecommunications">telecommunications</a> and <a href="Computing" title="Computing">computing</a>. For example, <a href="Synchronous" class="mw-redirect" title="Synchronous">synchronous</a> bitstreams are carried by <a href="SONET" class="mw-redirect" title="SONET">SONET</a>, and <a href="Transmission_Control_Protocol" title="Transmission Control Protocol">Transmission Control Protocol</a> transports an <a href="Asynchronous_communication" title="Asynchronous communication">asynchronous</a> bytestream.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Relationship_to_bytestreams">Relationship to bytestreams</h2></div>
<p>In practice, bitstreams are not used directly to encode bytestreams; a communication channel may use a signalling method that does not directly translate to bits (for instance, by transmitting signals of multiple frequencies) and typically also encodes other information such as <a href="Frame_synchronization" title="Frame synchronization">framing</a> and <a href="Error_correction" class="mw-redirect" title="Error correction">error correction</a> together with its data.
</p>
<div class="mw-heading mw-heading2"><h2 id="Examples">Examples</h2></div>
<p>The term bitstream is frequently used to describe the configuration data to be loaded into a <a href="Field-programmable_gate_array" title="Field-programmable gate array">field-programmable gate array</a> (FPGA). Although most FPGAs also support a byte-parallel loading method as well, this usage may have originated based on the common method of configuring the FPGA from a serial bit stream, typically from a serial <a href="Programmable_read-only_memory" class="mw-redirect" title="Programmable read-only memory">PROM</a> or <a href="Flash_memory" title="Flash memory">flash memory</a> chip. The detailed format of the bitstream for a particular FPGA is typically proprietary to the FPGA vendor.
</p><p>In mathematics, several specific <a href="Infinite_sequences" class="mw-redirect" title="Infinite sequences">infinite sequences</a> of bits have been studied for their mathematical properties; these include the <a href="Baum%E2%80%93Sweet_sequence" title="Baum–Sweet sequence">Baum–Sweet sequence</a>, <a href="Ehrenfeucht%E2%80%93Mycielski_sequence" title="Ehrenfeucht–Mycielski sequence">Ehrenfeucht–Mycielski sequence</a>, <a href="Fibonacci_word" title="Fibonacci word">Fibonacci word</a>, <a href="Kolakoski_sequence" title="Kolakoski sequence">Kolakoski sequence</a>, <a href="Regular_paperfolding_sequence" title="Regular paperfolding sequence">regular paperfolding sequence</a>, <a href="Rudin%E2%80%93Shapiro_sequence" title="Rudin–Shapiro sequence">Rudin–Shapiro sequence</a>, and <a href="Thue%E2%80%93Morse_sequence" title="Thue–Morse sequence">Thue–Morse sequence</a>.
</p><p>On most <a href="Operating_systems" class="mw-redirect" title="Operating systems">operating systems</a>, including <a href="Unix-like" title="Unix-like">Unix-like</a> and <a href="Windows" class="mw-redirect" title="Windows">Windows</a>, standard I/O libraries convert lower-level paged or buffered <a href="File_access" class="mw-redirect" title="File access">file access</a> to a bytestream paradigm. In particular, in Unix-like operating systems, each process has three <a href="Standard_streams" title="Standard streams">standard streams</a>, which are examples of unidirectional bytestreams. The <a href="Pipeline_(Unix)" title="Pipeline (Unix)">Unix pipe mechanism</a> provides bytestream communications between different processes.
</p><p>Compression algorithms often code in bitstreams, as the 8 bits offered by a byte (the smallest addressable unit of memory) may be wasteful. Although typically implemented in <a href="Low-level_programming_language" title="Low-level programming language">low-level languages</a>, some <a href="High-level_programming_language" title="High-level programming language">high-level languages</a> such as Python<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> and Java<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> offer native interfaces for bitstream I/O.
</p><p>One well-known example of a <a href="Communication_protocol" title="Communication protocol">communication protocol</a> which provides a byte-stream service to its clients is the <a href="Transmission_Control_Protocol" title="Transmission Control Protocol">Transmission Control Protocol</a> (TCP) of the <a href="Internet_protocol_suite" title="Internet protocol suite">Internet protocol suite</a>, which provides a bidirectional bytestream.
</p><p>The <a href="Internet_media_type" class="mw-redirect" title="Internet media type">Internet media type</a> for an arbitrary bytestream is <style data-mw-deduplicate="TemplateStyles:r886049734">
/* start https://en.wikipedia.org/ */


.mw-parser-output .monospaced{font-family:monospace,monospace}


/* end https://en.wikipedia.org/ */
</style><span class="monospaced">application/octet-stream</span>. Other media types are defined for bytestreams in well-known formats.
</p>
<div class="mw-heading mw-heading2"><h2 id="Flow_control">Flow control</h2></div>
<p>Often the contents of a bytestream are dynamically created, such as the data from the keyboard and other peripherals (/dev/tty), data from the <a href="Pseudorandom_number_generator" title="Pseudorandom number generator">pseudorandom number generator</a> (<a href=".//dev/urandom" class="mw-redirect" title="/dev/urandom">/dev/urandom</a>), etc.
</p><p>In those cases, when the destination of a bytestream (the consumer) uses bytes faster than they can be generated, the system uses <a href="Process_synchronization" class="mw-redirect" title="Process synchronization">process synchronization</a> to make the destination wait until the next byte is available.
</p><p>When bytes are generated faster than the destination can use them and the producer is a software algorithm, the system pauses it with the same process synchronization techniques. When the producer supports <a href="Flow_control_(data)" title="Flow control (data)">flow control</a>, the system only sends the <i>ready</i> signal when the consumer is ready for the next byte. When the producer can not be paused—a keyboard or some hardware that does not support flow control—the system typically attempts to temporarily store the data until the consumer is ready for it, typically using a <a href="Queue_(abstract_data_type)" title="Queue (abstract data type)">queue</a>. Often the receiver can empty the buffer before it gets completely full. A producer that continues to produce data faster than it can be consumed, even after the buffer is full, leads to unwanted <a href="Buffer_overflow" title="Buffer overflow">buffer overflow</a>, <a href="Packet_loss" title="Packet loss">packet loss</a>, <a href="Network_congestion" title="Network congestion">network congestion</a>, and <a href="Denial_of_service" class="mw-redirect" title="Denial of service">denial of service</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1184024115">
/* start https://en.wikipedia.org/ */


.mw-parser-output .div-col{margin-top:0.3em;column-width:30em}.mw-parser-output .div-col-small{font-size:90%}.mw-parser-output .div-col-rules{column-rule:1px solid #aaa}.mw-parser-output .div-col dl,.mw-parser-output .div-col ol,.mw-parser-output .div-col ul{margin-top:0}.mw-parser-output .div-col li,.mw-parser-output .div-col dd{page-break-inside:avoid;break-inside:avoid-column}


/* end https://en.wikipedia.org/ */
</style><div class="div-col" style="column-width: 20em;">
<ul><li><a href="Bit_banging" title="Bit banging">Bit banging</a></li>
<li><a href="Bit-stream_access" title="Bit-stream access">Bit-stream access</a></li>
<li><a href="Bitstream_format" title="Bitstream format">Bitstream format</a></li>
<li><a href="Byte-oriented_protocol" title="Byte-oriented protocol">Byte-oriented protocol</a></li>
<li><a href="MPEG_elementary_stream" title="MPEG elementary stream">MPEG elementary stream</a></li>
<li><a href="Reliable_byte_stream" title="Reliable byte stream">Reliable byte stream</a></li>
<li><a href="Stream_(computing)" title="Stream (computing)">Stream (computing)</a></li>
<li><a href="Stream_processing" title="Stream processing">Stream processing</a></li>
<li><a href="Traffic_flow_(computer_networking)" title="Traffic flow (computer networking)">Traffic flow (computer networking)</a></li></ul>
</div>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://pypi.python.org/pypi/bitstream">"Bitstream"</a>. Python Software Foundation. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20160908204954/https://pypi.python.org/pypi/bitstream">Archived</a> from the original on 2016-09-08.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.oracle.com/javase/8/docs/api/java/util/BitSet.html">"Class BitSet"</a>. Oracle. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20161130021926/http://docs.oracle.com/javase/8/docs/api/java/util/BitSet.html">Archived</a> from the original on 2016-11-30.</cite></span>
</li>
</ol></div></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2024-07-08" href="https://en.wikipedia.org/wiki/?title=Bitstream&amp;oldid=1233344192">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>